From: Haojian Zhuang Date: Wed, 21 Nov 2018 01:19:49 +0000 (+0800) Subject: mmc: poll eMMC status after EXT_CSD command X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=93768644799a71e391c3676abe6508107df9f997;p=project%2Fbcm63xx%2Fatf.git mmc: poll eMMC status after EXT_CSD command EXT_CSD command needs to access data from eMMC device. Add the operation of polling eMMC device status. Make sure the command is finished. Signed-off-by: Haojian Zhuang --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 418ab112..02bf770e 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -246,6 +246,13 @@ static int mmc_fill_device_info(void) return ret; } + do { + ret = mmc_device_state(); + if (ret < 0) { + return ret; + } + } while (ret != MMC_STATE_TRAN); + nb_blocks = (mmc_ext_csd[CMD_EXTCSD_SEC_CNT] << 0) | (mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 1] << 8) | (mmc_ext_csd[CMD_EXTCSD_SEC_CNT + 2] << 16) |